from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

driver = webdriver.Chrome()
driver.maximize_window()
driver.get('https://www.baidu.com')

# driver.find_element(By.NAME, 'wd').send_keys('根据name属性定位')
# driver.find_elements(By.NAME, 'wd')[0].send_keys('根据name属性定位')
# driver.find_element(By.LINK_TEXT, '新闻').click()  #
driver.find_element(By.PARTIAL_LINK_TEXT, '新').click()  # 新闻
sleep(2)
driver.close()